
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp"%>\
<%
	String contextPath = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>系统密码修改</title>

     <script src="<%=contextPath %>/js/jquery/jquery-1.7.1.min.js" type="text/javascript"></script> 
    <style type="text/css">
     
    </style>
    <script type="text/javascript">
    function updatePassword()
    {
        var oldPassword = $("#oldPassword").val();
        var newPassword = $("#newPassword").val();
        var twoNewPassword = $("#twoNewPassword").val();
      
        if (oldPassword == "")
        {
            alert('密码不能为空!');
            $("#oldPassword").focus();
            return false;
        }
        if(newPassword != twoNewPassword){
        	alert('新密码两次输入的不相同 !');
            $("#twoNewPassword").focus();
            return false;
        }
        
        if(newPassword == ""){
    		alert('密码不能为空!');
            $("#newPassword").focus();
            return false;
    	}
        
        if(twoNewPassword == ""){
        	alert('密码不能为空!');
            $("#twoNewPassword").focus();
            return false;
        }     
    }
    </script>
</head>
<body style="padding:10px;text-align: center;"> 
<form name="form1" method="post" action="${pageContext.request.contextPath}/security/user/updatePassword.do" style="text-align: center;margin: 0">
        <table style="margin: 0;text-align: center;">
            <tr>
                            <td align="left" colspan="2"> 
                             <h3>系统密码修改</h3>
                            </td>
                         </tr> 
                         <tr>
                            <td id="msg" colspan="2">
                            	<c:if test="${!updatePasswordSuccess }">
                            		<c:out value="${updatePasswordError }"></c:out>
                            	</c:if>
                            	<c:if test="${updatePasswordSuccess }">
                            		<c:out value="密码修改成功 !"></c:out>
                            	</c:if>
                            </td>
                         </tr>
                         <tr>
                            <td align="right">原密码：</td><td align="left"><input type="password" name="oldPassword" id="oldPassword"/></td>
                         </tr> 
                         <tr>
                            <td align="right">新密码：</td><td align="left"><input type="password" name="newPassword" id="newPassword"/></td>
                         </tr> 
                         <tr>
                            <td align="right">确认新密码：</td><td align="left"><input type="password" name="twoNewPassword" id="twoNewPassword"/></td>
                         </tr> 
                         <tr>
                            <td align="center" colspan="2">
                                <input type="submit" onclick="return updatePassword()" name="btn" value="确认"/>
                            </td>
                         </tr> 
                    </table>    
    </form>
</body>
</html>
